#!/usr/bin/env python

class Nidaqmx(object):
    
    @staticmethod
    def calcRate(frequency):
        if frequency == '.125 ms': index = 0
        elif frequency == '.25 ms': index = 1
        elif frequency == '.5 ms': index = 2
        elif frequency == '1 ms': index = 3
        elif frequency == '2 ms': index = 4
        elif frequency == '4 ms': index = 5
        elif frequency == '8 ms': index = 6
        elif frequency == '16 ms': index = 7
        elif frequency == '32 ms': index = 8
        else: index = 0
        return 1000 / (0.125 * (2 ** index))
        